package com.start.pay.core.entity;

import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

@Data
 @Schema(name="StartOrderQueryResult", description = "订单查询")
public class StartOrderPayStateQueryResult {
     @Schema(name="系统订单支付结果")
    private Integer startOrderPayState;
     @Schema(name="第三方平台订单查询结果")
    private Integer platformPayState;


     @Schema(name="最终支付结果")
    public Integer getFinalPayState() {
        if (startOrderPayState == null) {
            return null;
        }
        if (platformPayState == null) {
            return startOrderPayState;
        }
        if (startOrderPayState.equals(platformPayState)) {
            return startOrderPayState;
        }
        return platformPayState;
    }
}
